package io.github.javpower.knowledgerag.config;

import io.swagger.v3.oas.models.OpenAPI;
import org.springdoc.core.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author gc.x
 * @date 2022/10/27
 **/
@Configuration
public class OpenApiConfig {


    @Bean
    public OpenAPI openApi() {
        return new OpenAPI();
    }

    @Bean
    public GroupedOpenApi systemApi() {
        String[] packagedToMatch = {"io.github.javpower"};
        return GroupedOpenApi.builder()
                .group("RAG doc")
                .pathsToMatch("/**")
                .packagesToScan(packagedToMatch).build();
    }

}
